<template>
<div class="newsItem" @click="goDetial">
  <div class="time">
    <span class="dd">{{ params.createdTime | timeFormateDD}}</span>
    <span class="ym">{{ params.createdTime | timeFormateYYYYMM}}</span>
  </div>
  <div class="content">
    <span class="title">{{ params.title }}</span>
    <span class="des">{{ params.content | clearEditor}}</span>
  </div>
</div>
</template>

<script>
export default {
  name: "newsItem",
  methods:{
    goDetial(){
      let {href} = this.$router.resolve({name:'newsSingle',query: { id: this.params.id } })
      window.open(href,'_blank')
    },
  },
  props:{
    params:{
      default:()=>{}
    }
  }
}
</script>

<style scoped lang="less">
.newsItem{
  display: flex;
  align-items: center;
  padding: 0px 0 18px;
  cursor: pointer;
  .time{
    display: flex;
    flex-direction: column;
    color: #BBBBBB;
    align-items: center;
    margin-right: 20px;
    .dd{
      font-size: 50px;
    }
    .ym{
      font-size: 12px;
    }
  }
  .content{
    display: flex;
    flex-direction: column;
    .title{
      font-size: 14px;
      margin-bottom: 8px;
    }
    .des{
      display: inline-block;
      width: 600px;
      font-size: 12px;
      color: #666666;
      overflow:hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      -o-text-overflow:ellipsis;
    }
  }
}
</style>